<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <link href="/static/layui/css/layui.css" rel="stylesheet" type="text/css">
</head>
<div style="padding:10px 50px 10px 10px">
    <form id="recordForm" class="layui-form">
        <div style="margin-bottom:20px;font-size:14px;border-bottom:1px solid #ccc; padding-bottom: 5px;">日志信息</div>
        <ul class="layui-timeline">
            @@ for(note in notes){ $$
            <li class="layui-timeline-item">
                <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                <div class="layui-timeline-content layui-text">
                    <h3 class="layui-timeline-title">
                        ${note.createTime!,dateFormat="yyyy-MM-dd"}<span style="width: 50px"></span> ${note.staff}
                    </h3>
                    <p>
                        ${note.remark}
                    </p>
                </div>
            </li>
            @@ } $$

            @@ if(notes.~size == 0) { $$
            <li class="layui-timeline-item">
                <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                <div class="layui-timeline-content layui-text">
                    <h2 class="layui-timeline-title">没有日志</h2>
                </div>
            </li>
            @@ } $$

        </ul>
    </form>
</div>
<script src="/static/jquery/jquery.min.js"></script>
<script src="/static/layui/layui.js"></script>
<script src="/static/jqgrid/jquery.jqGrid.minffe4.js?0820"></script>
<script src="/static/jqgrid/myjqGrid.js?v=1.0.1"></script>
<script type="text/javascript">
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(*)', function(data){
            var recordId = '${record.id}';
            var form = $("#recordForm");
            var formData = form.serialize();
            formData.detail = $("#detail").html();
            $.post(form.attr("action"), formData, function(data){
                if(data.status == 200){
                    layer.alert(data.msg, {
                        icon: 1,
                        skin: 'layer-ext-moon'
                    },function () {
                        parent.myJqGrid.reloadGrid({});
                        parent.layer.closeAll();
                    });
                }else{
                    layer.alert(data.msg, {
                        icon: 2,
                        skin: 'layer-ext-moon'
                    });
                }
            });
            return false; //阻止表单跳转。
        });
    });
    function closeAll() {
        parent.layer.closeAll();
    }
</script>